package com.it;

import java.util.Random;

public class Arr5 {
    public static void main(String[] args) {
        int [] arr = {1,2,3,4,5};
       /* for (int i=0,j=arr.length-1;i<j;i++,j--) {
            int temp=arr[i];
            arr[i]=arr[j];
            arr[j]=temp;
        }
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i]+" ");
        }*/
        Random r = new Random();
        int index = r.nextInt(arr.length);
        for (int i = 0; i < arr.length; i++) {
            int temp = arr[index];
            arr[index] = arr[i];
            arr[i] = temp;
        }
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i]+" ");
        }
    }
}
